package com.zqwh.storemonitor.api;

import com.zqwh.storemonitor.domain.Shop;
import com.zqwh.storemonitor.domain.ShopBell;
import com.zqwh.storemonitor.domain.ShopWatcher;
import com.zqwh.yj.sdk.utils.httpRequest.beans.HttpResult4;

import java.util.List;

import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;

public interface WatcherApi {

    @POST("api/shopwatcher/cid")
    Observable<HttpResult4<Object>> setGeTuiCid(@Query("shopWatcherId") Integer shopWatcherId,
                                                @Query("cid") String cid);

    /**
     * 获取萤石云Token
     * @return
     */
    @GET("api/shopwatcher/ys/access-token")
    Observable<HttpResult4<String>> getAccessToken();

    /**
     * 看店员登录
     * @return
     */
    @POST("api/shopwatcher/login")
    Observable<HttpResult4<ShopWatcher>> login(@Query("account") String account,
                                               @Query("password") String password);

    /**
     * 看店员登录
     * @return
     */
    @GET("api/shopwatcher/shop/list")
    Observable<HttpResult4<List<Shop>>> getShopList(@Query("shopWatcherId") int shopWatcherId);

    /**
     * 看店员登录
     * @return
     */
    @GET("api/shopwatcher/shop/list")
    Observable<HttpResult4<List<ShopBell>>> getShopBellList(@Query("shopWatcherId") int shopWatcherId);


    /**
     * 设置是否允许出店
     * @param devSn
     * @param isOutAllow
     * @return
     */
    @POST("api/shopwatcher/shop/setOutAllow")
    Observable<HttpResult4<ShopBell>> setOutAllow(@Query("devSn") String devSn, @Query("isOutAllow") boolean isOutAllow);

    /**
     * 获取允许出店状态
     * @param devSn
     * @return
     */
    @POST("api/shopwatcher/shop/getOutAllow")
    Observable<HttpResult4<Boolean>> getOutAllow(@Query("devSn") String devSn);
}
